#!/usr/bin/env bash

# theme
BG_COMMAND="feh --bg-tile $HOME/.wm/walls/tiled/seigaiha.png"
emacs_theme="base16-grayscale-dark"
emacs_powerline_scale="1.2"

# bspwm
b_border_width=4
b_window_gap=20
b_normal_border_color=$(colort 20 -t $p_bg_normal)
b_active_border_color=$(colort 50 -t $p_bg_normal)
b_focused_border_color=$(colort 80 -t $p_bg_normal)


#panel
p_bg_active="#ff$b_focused_border_color"

theme_section_bg="$(colort +10 $p_bg_normal)"
p_bg_normal="#ff$b_active_border_color"
p_fg_active=$p_fg_normal

p_format="dropdown:desktop|title|clock"
p_format_2="desktop:github:themeSwitch|title|dynamicmpd:volume:clock"
p_format_3="desktop|title|weather"

background="$(colort 3 -t $background)"

p_height=24
p_gap=0
p_line=3
p_class="noshadow"
p_line=2
p_padding=6

p_font_main="Roboto Mono-11"
p_font_icon="FontAwesome-12" # Panel Icon font.
p_icon_enable=false
d_font="Roboto Mono 10"

p_desktop_occupied_label="$(echo -n -e '\uf111')"
p_desktop_empty_label="$(echo -n -e '\uf1db')"

p_desktop_display_format=together

st_font="Roboto Mono-11"
p_title_only_show_active=true
maxWinNameLen=30

GTK_FONT="Roboto Mono 10"

activeline() {
    activefg
}

line() {
    bg
}

even_section() {
    iif "[ $((step%2)) -eq 0 ]" false true
}

stepSetup() {
    separateStep
}

fg() {
    colort -c "$(bg)" && check="$p_bg_normal" || check="$p_fg_normal"
    input="$(colort -c "$check" && echo $p_fg_normal || echo $p_bg_normal)"
    iif $(even_section) "$input" "$(colort 60 $input)"
}

activebg() {
    bg
}

bg() {
    iif $(even_section) "$p_bg_active" "$theme_section_bg"
}

suffix() {
  border="%%{B$(colort 30 $theme_section_bg)}%%{O2}%%{B-}"
  iif $(even_section) "" "$border"
}

prefix() {
  border="%%{B$(colort 30 $theme_section_bg)}%%{O2}%%{B-}"
  iif $(even_section) "" "$border"
}